package unseen.labs.games.gamecontroller;

import unseen.labs.games.gamecontroller.ui.component.Joystick;
import unseen.labs.games.gamecontroller.view.GenericView;
import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.widget.ViewAnimator;

public class MyGameController extends Activity {
	
	private GenericView _genericView;
	private ViewAnimator mViewAnimator;
	
	private Joystick _joystick;
	
	private static final int INGAME_VIEW 	= 0;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        setContentView(R.layout.generic_screen);
        
        initView();
        
    }

	private void initView() {
		mViewAnimator = (ViewAnimator) findViewById(R.id.view_animator);	
		mViewAnimator.setDisplayedChild(INGAME_VIEW);
		
		_genericView = (GenericView) findViewById(R.id.glsurface_view);
		
		_joystick = (Joystick) findViewById(R.id.joystick);
		_joystick.setSurfaceView(_genericView);
	}
	
	
}